package com.blog.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.blog.service.entity.ArticleComment;
import com.blog.service.inter.ArticleCommentService;
import com.blog.service.model.ArticleCommentMapper;

/**
 * 文件名： com.blog.service.impl.ArticleCommentServiceImpl.java
 * 作者： WenBin
 * 日期： 2017年4月12日
 * 功能说明： 日志评论服务类
 * =========================================================
 * 修改记录：
 * 修改作者 日期 修改内容
 * =========================================================
 * Copyright (c) 2010-2011 .All rights reserved.
 */
@Service
public class ArticleCommentServiceImpl implements ArticleCommentService {

	@Autowired
	private ArticleCommentMapper articleCommentMapper;

	@Override
	public ArticleComment saveArticleComment(ArticleComment ac) {

		int i = articleCommentMapper.insertSelective(ac);
		if (i > 0) {
			return ac;
		}
		return null;
	}

	@Override
	public ArticleComment updateArticleComment(ArticleComment ac) {

		int i = articleCommentMapper.updateByPrimaryKey(ac);
		if (i > 0) {
			return ac;
		}
		return null;
	}

	@Override
	public ArticleComment deleteArticleComment(ArticleComment ac) {

		int i = articleCommentMapper.deleteByPrimaryKey(ac.getArticleId());
		if (i > 0) {
			return ac;
		}
		return null;
	}

}
